package com.cq.service.impl;

import com.cq.mapper.RoleMapper;
import com.cq.pojo.Admin;
import com.cq.pojo.Role;
import com.cq.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 悠久的苍穹
 * @Date: 2021/1/14 15:46
 * @Description: ${description}
 * @Version: 1.0
 */
@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    RoleMapper roleMapper;

    @Override
    public Role findRoleByAdminId(Integer adminId) {
        return roleMapper.findRoleByAdminId(adminId);
    }

    @Override
    public List<Role> getRoleList() {
        return roleMapper.getRoleList();
    }

    @Override
    public int addAdminRole(Integer adminId, Integer roleId) {
        return roleMapper.addAdminRole(adminId,roleId);
    }

    @Override
    public int updateAdminRole(Integer adminId, Integer roleId) {
        return roleMapper.updateAdminRole(adminId,roleId);
    }

    @Override
    public void deleteRoleById(int id) {
        roleMapper.deleteRoleById(id);
    }

    @Override
    public Role findRoleById(int id) {
        return roleMapper.findRoleById(id);
    }

    @Override
    public int updateRole(Role role) {
        return roleMapper.updateRole(role);
    }

    @Override
    public int addRole(Role role) {
        return roleMapper.addRole(role);
    }

    @Override
    public void deleteRole(Integer id2) {
        roleMapper.deleteRole(id2);
    }
}
